export const randomInt = (start, end) => {
    const l = end - start
    if (l <= 0) {
        return start
    } else {
        const s = Math.random() * l
        const r = start + Math.floor(s)
        return r
    }
}

export const randomAt = (list) => {
    if (!Array.isArray(list) || !list) {
        return undefined
    } else {
        const i = randomInt(0, list.length)
        const e = list[i]
        return e
    }
}
